<template>
  <div v-if="arr !== undefined">
    <div class="list" v-for="val in arr" :key="val.resourceId">
      <div class="left">
        <img :src="val.uiElement.image.imageUrl" alt="" />
        <i class="iconfont icon-bofang"></i>
      </div>
      <div class="right">
        <div class="right-left">
          <p>{{ val.uiElement.mainTitle.title }}</p>
          <span>NO</span>
        </div>
        <div class="right-right">
          <span v-if="val.uiElement.rcmdShowType !== 'DEFAULT'">{{
            val.resourceExtInfo.artists[0].name
          }}</span>
          <i v-else class="iconfont icon-bofang02"></i>
        </div>
      </div>
    </div>
  </div>
  <div v-else-if="song !== undefined">
    <div class="list" v-for="val in song" :key="val.sid">
      <div class="left">
        <img :src="val.songPicture" alt="" />
        <i class="iconfont icon-bofang"></i>
      </div>
      <div class="right">
        <div class="right-left">
          <p>{{ val.aname }}</p>
          <span>{{ val.singerName }}</span>
        </div>
        <div class="right-right">
          <!-- <span v-if="val.uiElement.rcmdShowType !== 'DEFAULT'">{{
            val.resourceExtInfo.artists[0].name
          }}</span> -->
          <i class="iconfont icon-bofang02"></i>
        </div>
      </div>
    </div>
    {{ arr }}
  </div>
</template>

<script>
export default {
  props: ["arr", "song"],
  mounted() {
    // console.log(this.props.arr);
  },
};
</script>

<style lang="less" scoped>
.list {
  display: flex;
  .left {
    position: relative;
    width: 0.97rem;
    height: 0.97rem;
    // background-color: seagreen;
    text-align: center;
    line-height: 0.97rem;
    margin-right: 0.18rem;
    img {
      width: 0.97rem;
      height: 0.97rem;
      border-radius: 0.12rem;
    }
    i::before {
      display: inline-block;
      font-size: 0.29rem;
      position: absolute;
      left: 0;
      top: 0;
      right: 0;
      bottom: 0;
      margin: auto;
    }
  }
  .right {
    width: 5.25rem;
    margin-right: 0.5rem;
    display: flex;
    .right-left {
      display: flex;
      flex-direction: column;
      justify-content: center;
      width: 4.15rem;
      height: 1.15rem;
      border-bottom: 0.02rem solid #f1f1f1;
      font-size: 0.3rem;
      span {
        font-size: 0.19rem;
      }
    }
    .right-right {
      width: calc(100% - 4.15rem);
      text-align: right;
      i {
        font-size: 0.4rem;
        line-height: 1.15rem;
      }
    }
  }
}
</style>